package neuroBot.input.party;
import java.awt.AWTException;
import java.awt.Color;
import java.awt.Robot;

import neuroBot.exploit.Util;

public class IEErrorWindowCloser {
	public Robot	rob;
	public Color	matchCol	= new Color(255, 255, 0);

	public IEErrorWindowCloser() {
		try{
			rob = new Robot();
		}catch(AWTException e){
			e.printStackTrace();
		}
	}

	public void check() {
		if(isIEErrorWindowVisible()) closeIEErrorWindow();
	}

	public void closeIEErrorWindow() {
		System.out.println("IEErrWinClsr: closing Err-Win");
		Util.click(655, 610);
	}

	public boolean isIEErrorWindowVisible() {
		Color col = rob.getPixelColor(510, 420);
		return col.equals(matchCol);
	}
}
